
  export function delcommafy(num){
    var reg = /\.\d+/g //"\."匹配“.”字符，"d+"匹配多个数字，最后一个g表示要全局匹配所有结果
    var result = num.match(reg)  //返回符合的字体串数组
    if(result == '.00'){
        num = num.replace('.00', '')
    }
    num = num.replace(/,/gi, '') 
    return num
  }

  export function toThousandsNoZero(num) {    
    return num ? ( (isNaN(parseFloat(num.toString().replace(/,/g, ""))) ? 1 : parseFloat(num.toString().replace(/,/g, "")))).toFixed(2).toString().replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
        return $1 + ",";
    }) : "";
}
export function projectAmounts(num){//this.form.projectAmount 金额
  if(isNaN(parseFloat(num))){
    num= 0.00;
    return num
  }else{
    return num ? ( (isNaN(parseFloat(num.toString().replace(/,/g, ""))) ? 1 : parseFloat(num.toString().replace(/,/g, "")))).toFixed(2).toString().replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
        return $1 + ",";
    }) : "";
  }
}